In-Depth Coverage of the Icon Programming Language

ثبت نشده
چکیده

Here's the challenge: Model string synthesis with the mapping expr1 ? expr2 → Eform(Bform(expr1),expr2) and provide appropriate procedures for Bform() and Eform(). Use the global variables subject, s_pos, object, and o_pos for the state variables. (Do not use &subject and &pos.) In addition, provide the following analysis and synthesis procedures: • smove(i) and stab(i), which are the same as move(i) and tab(i) in string scanning. • omove(i) and otab(i), which are the same as smove(i) and stab(i), except they apply to the object, not the subject. • oplace(s), which inserts s in the object following the current position in it, changes the position to the end of the inserted string, and returns the new value of the position. • xswap(), which swaps the values of the subject and the object, and sets both positions to 1. • odelete(i), which deletes the i characters of the object following the current position. It does not change the position, but returns it as value. • spos(i), which is the same as pos(i) for string scanning. • opos(i), which is the same as spos(i), but for the object, instead of the subject. Here's an example of the use of these procedures: write("abcde" ? { while smove(1) do oplace(smove(1)) oplace("]") otab(1) oplace("[") }) The value written is [bd]. Take this as an exercise and see what you can do with it. Don't hesitate to try to improve on the procedures suggested here. We'll give our solution to this exercise in the next issue of the Analyst.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

In-Depth Coverage of the Icon Programming Language Shaft Arithmetic

Shaft Arithmetic ............................................ 1 Periodic Sequences ....................................... 5 Finding Repeats ............................................ 7 Name Drafting ............................................ 11 Variations on Versum Sequences ............. 15 Answers to Last Quiz ................................. 18 From the Library ...........................

متن کامل

In-Depth Coverage of the Icon Programming Language

Weave Draft Representation ....................... 1 From the Library ........................................... 3 Graphics Corner ............................................ 4 Exploring Sequences Interactively ............. 7 Answers to Quiz ........................................... 9 Woven Images ............................................. 10 Shadow-Weave Wallpaper ........................

متن کامل

Analyzing Character Patterns

About This Issue ................................ 1 Analyzing Character Patterns .......... 1 Versum Deltas .................................... 7 Graphics Corner ............................... 10 Tricky Business ................................ 14 From the Library .............................. 19 What’s Coming Up ..........................20 In-Depth Coverage of the Icon Programming Language...

متن کامل

In-Depth Coverage of the Icon Programming Language

10. Avoid long lines. Instead, continue expressions on as many lines as are needed for easy readability. See the first two issues of The Icon Analyst for the proper techniques for breaking lines. Similarly, continue long string and cset literals on several lines if that’s necessary to make them readable. See Appendix A of the second edition of The Icon Programming Language for the method of con...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1991